<template>
  <el-card :body-style="{ padding: '20px' }" shadow="hover">
    <div class="card-content">
      <div class="card-header">
        <div class="card-title">{{ title }}</div>
        <el-icon v-if="showIcon">{{ icon }}</el-icon>
      </div>
      <div class="card-value">{{ value }}</div>
      <div v-if="description" class="card-description">{{ description }}</div>
    </div>
  </el-card>
</template>

<script>
export default {
  name: 'StatusCard',
  props: {
    title: {
      type: String,
      required: true
    },
    value: {
      type: [String, Number],
      required: true
    },
    description: {
      type: String,
      default: ''
    },
    icon: {
      type: Object,
      default: null
    },
    showIcon: {
      type: Boolean,
      default: true
    }
  }
}
</script>

<style scoped>
.card-content {
  text-align: center;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-title {
  font-size: 14px;
  color: #606266;
  font-weight: 500;
}

.card-value {
  font-size: 28px;
  font-weight: 600;
  color: #303133;
  margin-bottom: 8px;
}

.card-description {
  font-size: 12px;
  color: #909399;
}
</style>